﻿@{
    Layout = "~/Views/Shared/_LayoutTopicDefault.cshtml";
}
@Styles.Render("~/Content/css")
<style>
    .wrap {
        min-height: initial;
        padding-bottom: 0px;
    }
    .top {
        height: 45px;
    }
    .disnone {
        display: none;
    }
</style>
<div class="wrap reader-con">

    <!--面包屑一-->
    <div class="crumbLink"><a href="javascript:void(0);">首页</a>&gt;<a href="javascript:void(0);">文献在线阅读</a></div>

    <!-- read-containerSTART -->
    <div class="m-s-top clearfix">
        <h1 class='online-h1-24'></h1>
    </div>
    <div class="reader-container posr" style='height: 837px;'>
        <iframe id="view_frame" width="100%" height="100%"></iframe>
    </div>
    <!-- end read-container -->
</div>
<!--内容==结束-->
<!--  工具条 -->
@*<iframe style="bottom: 0; left: 0; position: fixed; border: none; text-align: left; width: 100%; z-index: 1000; background-color: white; height: 46px;"></iframe>*@
<!--  工具条END -->



<script type="text/javascript">
    $(document).ready(function () {
        if ("@ViewBag.IsFileExsit" == "False") {
            messageAlert('请求的资源不存在');
            window.close();
            return;
        }
        if (window.ActiveXObject || "ActiveXObject" in window) {
            //判断是否为IE浏览器，"ActiveXObject" in window判断是否为IE11
            //判断是否安装了adobe Reader
            for (x = 2; x < 10; x++) {
                try {
                    oAcro = eval("new ActiveXObject('PDF.PdfCtrl." + x + "');");
                    if (oAcro) {
                        flag = true;
                    }
                } catch (e) {
                    flag = false;
                }
            }
            try {
                oAcro4 = new ActiveXObject('PDF.PdfCtrl.1');
                if (oAcro4) {
                    flag = true;

                }
            } catch (e) {
                flag = false;
            }
            try {
                oAcro7 = new ActiveXObject('AcroPDF.PDF.1');
                if (oAcro7) {
                    flag = true;
                }
            } catch (e) {
                flag = false;
            }
            if (flag) {
                $('#view_frame').attr('src', '@Html.Raw(ViewBag.OnlineViewUrl)');
            }
            else {
                alert("对不起,您还没有安装PDF阅读器软件呢,为了方便预览PDF文档,请选择安装！");
                location = "http://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.3/chs/AdbeRdr930_zh_CN.exe";
            }
        } else {
            $('#view_frame').attr('src', '@Html.Raw(ViewBag.OnlineViewUrl)');
        }
       // alert(navigator.userAgent);
    })
</script>